Windows Media Services banner art

Timing values

A timing attribute and its value define the aspects of an element's behavior that relate to time and sequence. For example, the timing value assigned to a begin attribute defines when an element starts playing; while the timing value assigned to a clipEnd attribute defines when a media element ends. If an attribute has no assigned value, the default value is used.

Timing values are specified as either clock values or as events. In cases where a clock value is used, the value can be shown in the following ways (where h is hours, m is minutes, s is seconds and ms is milliseconds):

For more information about clock value time formats, see Time formats.

Timing values that are specified as events consist of the id attribute value of the trigger element followed by a period (.) and the attribute of the trigger element on which the timing is based. For example, a begin attribute value of Advert1.begin means that an element is set to begin playing when the media element Advert1 starts.

The following sections describe the supported timing values and their use.

SyncBase

A SyncBase timing value is a value that is based on the timing of another element or on an event. SyncBase timing values can only be used with excl and media elements.

The default SyncBase value is the start of the parent element. The following is an example of an attribute using a SyncBase value. In this case, the begin attribute is dependant upon the end of the Advert1 media element:

begin="Advert1.end"

Offset

An offset timing value refers to the length of time between a specific event and the time you want to specify. If no event is specified, the default event that is used for offset timing values is the SyncBase timing value. For example, given the SyncBase value in the previous section, an offset timing value of +30s is equivalent to a value of Advert1.end+30s.

The first element in a playlist is indicated with an offset value of 0s or 00:00.

All of the following examples are valid offset values that result in a delay of 30 seconds from the SyncBase timing value:

end=30s
end=+30s
end=00:30
end=+00:30

SyncEvent

A SyncEvent timing value defines the timing value in relation to an event. In playlists, events are defined by the syncEvent attribute. For example, the wrapper playlist element could start based on a syncEvent attribute in a broadcast playlist. This timing value is specified using the syncEvent attribute value in the broadcast playlist followed by a period (.) and either begin or end. You can also combine a SyncEvent timing value with an offset timing value for greater flexibility. SyncEvent timing values can only be used with media and excl elements.

In the following example, the begin attribute uses a combination of SyncEvent and offset timing values to indicate a time of 10 seconds after the start of the element with a syncEvent attribute named AdEvent:

begin="AdEvent.begin+10s"

SyncToPrev

A SyncToPrev timing value bases the timing of an element on the beginning or end of the element that immediately preceded it. You can also combine a SyncToPrev timing value with an offset timing value for greater flexibility.

In the following example, the begin attribute indicates a time that corresponds to the end of the previous element:

begin="prev.end"

Event

An Event timing value bases the activation of an element on a server event. Typically, a server event is raised by script commands encoded in a broadcast stream. If a broadcast publishing point receives a FIRE_EVENT script command from a live stream, the server searches the playlist for a media element that has a begin attribute value equal to the value associated with the FIRE_EVENT command. If there is a matching media element, that element interrupts the broadcast.

Events can also be raised by a plug-in or by an application  based on  the Windows Media Services Software Development Kit (SDK). Events can only be used with excl and media elements.

In this example, if the server receives a script command from the broadcast stream with the type FIRE_EVENT and a value of AdEvent, the server interrupts the broadcast and plays the media element that has a begin attribute that matches the FIRE_EVENT value:

begin="AdEvent"

Indefinite

An attribute that has a timing value of indefinite is intentionally not defined. indefinite can be used with both the repeatCount and repeatDur attributes to cause the element to repeat until an event occurs to end the element. In this example, the repeatCount attribute is specified with an indefinite value so that the element will repeat for as long as the publishing point is active:

repeatCount="Indefinite"

Related topics


© 2000-2003 Microsoft Corporation. All rights reserved.